/*
 * @(#)Menu.java
 * 
 * Create Version: 1.0.0
 * Author: James Liu
 * Create Date: 2009-12-09
 * 
 * Copyright (c) 2009 ASPire Information Technologies Ltd. All Right Reserved.
 */
package com.aspire.boc.mms.wmf.cam;


import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;


/**
 * CAM value object.
 * 
 * @version 1.0.0   2009-12-09
 * @author  James Liu
 */
public class Menu implements Serializable {
    
    private static final long serialVersionUID = -7042822671396633978L;
    
    private int id;
    private String name;
    private String url;
    private String target;
    private String icon;
    private String tip;
    private int level;
    private Integer parentId;
    private Menu parent;
    private int order;
    
    private List<Menu> children = new ArrayList<Menu>();
    
    
    public int getId() {
    
        return id;
    }
    
    public void setId(int id) {
    
        this.id = id;
    }
    
    public String getName() {
    
        return name;
    }
    
    public void setName(String name) {
    
        this.name = name;
    }
    
    public String getUrl() {
    
        return url;
    }
    
    public void setUrl(String url) {
    
        this.url = url;
    }
    
    public String getTarget() {
    
        return target;
    }
    
    public void setTarget(String target) {
    
        this.target = target;
    }
    
    public String getIcon() {
    
        return icon;
    }
    
    public void setIcon(String icon) {
    
        this.icon = icon;
    }
    
    public String getTip() {
    
        return tip;
    }
    
    public void setTip(String tip) {
    
        this.tip = tip;
    }
    
    public int getLevel() {
    
        return level;
    }
    
    public void setLevel(int level) {
    
        this.level = level;
    }
    
    public Integer getParentId() {
    
        return parentId;
    }
    
    public void setParentId(Integer parentId) {
    
        this.parentId = parentId;
    }
    
    public Menu getParent() {
    
        return parent;
    }
    
    public void setParent(Menu parent) {
    
        this.parent = parent;
    }
    
    public int getOrder() {
    
        return order;
    }
    
    public void setOrder(int order) {
    
        this.order = order;
    }
    
    public List<Menu> getChildren() {
    
        return children;
    }
    
    public void setChildren(List<Menu> children) {
    
        this.children = children;
    }
    
public String toString() {
        
        StringBuilder result = new StringBuilder();
        
        result.append("Menu[id=")
              .append(this.getId())
              .append(", name=")
              .append(this.getName())
              .append(", url=")
              .append(this.getUrl())
              .append(", target=")
              .append(this.getTarget())
              .append(", icon=")
              .append(this.getIcon())
              .append(", tip=")
              .append(this.getTip())
              .append(", level=")
              .append(this.getLevel())
              .append(", parentId=")
              .append(this.getParentId())
              .append(", order=")
              .append(this.getOrder())
              .append(", subMenuCount=")
              .append(this.getChildren().size())
              .append("]");
        
        return result.toString();
    }
}